
// 钱包app包名
const waveAppPckageName = "com.wave.personal"

// 打开 wave app
const openWaveApp = () => {
    let pckName = waveAppPckageName;//app.getPackageName("Wave");
    console.log(Constant.UI_SDK_VERSION + "打开: Wave App: ", pckName);

    // com.wave.personal
    app.launchPackage(pckName)

    console.log(Constant.UI_SDK_VERSION + "等待10秒");
    sleep(10 * 1000);
}

// 退出 wave app
const closeWaveApp = () => {
    let pckName = waveAppPckageName;//app.getPackageName("Wave");
    //强制停止 momo com.consumerug
    console.log(Constant.UI_SDK_VERSION + "强制停止 Wave app: ", pckName);

    app.openAppSetting(pckName);
    text(app.getAppName(pckName)).waitFor();
    sleep(500);
    click("强行停止")
    console.log(Constant.UI_SDK_VERSION + app.getAppName(pckName) + "应用已被关闭");
    sleep(2 * 1000);
    click("确定");
    sleep(2 * 1000);
    back();
    sleep(5 * 1000);
}


module.exports = {
    openWaveApp: openWaveApp,
    closeWaveApp: closeWaveApp,
    waveAppPckageName: waveAppPckageName
};